import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/Home.vue'

Vue.use(VueRouter)

const routes = [
  /* 首页 */
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    /* 订单页 */
    path: '/dingdan',
    name: 'dingdan',
    component: () => import('../views/Dingdan/Dingdan.vue')
  },
  {
    /* 我的页 */
    path: '/wode',
    name: 'wode',
    component: () => import('../views/Wode/Wode.vue')
  },
  {
    /* 我的收藏页 */
    path: '/wodesc',
    name: 'wodesc',
    component: () => import('../views/Wode/Wodesc/Wodesc.vue')
  },
  {
    /* 我的地址页 */
    path: '/wodedz',
    name: 'wodedz',
    component: () => import('../views/Wode/Wodedz/Wodedz.vue')
  },
  {
    /* 单店铺详情 */
    path: '/detail',
    name: 'detail',
    component: () => import('../views/Detail/Detail.vue')
  },
  {
    /* 新增地址页 */
    path: '/addaddress',
    name: 'addaddress',
    component: () => import('../views/Wode/Wodedz/Addaddress.vue')
  },
  {
    /* 修改地址页 */
    path: '/redactaddress',
    name: 'redactaddress',
    component: () => import('../views/Wode/Wodedz/Redactaddress.vue')
  },
  {
    /* 搜索页 */
    path: '/search',
    name: 'search',
    component: () => import('../views/Home/Search.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
